/*
 * Copyright 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.seppiko.chart.utils.logging;

import org.seppiko.glf.api.Logger;
import org.seppiko.glf.api.LoggerFactory;

/**
 * @author Leonard Woo
 */
public class LoggingManager {

  private static final LoggingManager INSTANCE = new LoggingManager();

  public static LoggingManager getInstance() {
    return INSTANCE;
  }

  private Logger logger;

  public LoggingManager getLogger(String name) {
    logger = LoggerFactory.getLogger(name);
    return this;
  }

  public void info(String msg) {
    logger.info(msg);
  }

  public void warn(String msg) {
    logger.warn(msg);
  }

  public void warn(String msg, Throwable cause) {
    logger.warn(msg, cause);
  }

  public void error(String msg) {
    logger.error(msg);
  }

  public void error(String msg, Throwable cause) {
    logger.error(msg, cause);
  }

}
